//
//  UPNavigationController+Push.m
//  Uang Pasti
//
//  Created by 李永彬 on 2025/8/27.
//

#import "UINavigationController+Push.h"

@implementation UINavigationController (Push)

- (void)popToViewControllerOfClass:(Class)viewControllerClass animated:(BOOL)animated {
    for (UIViewController *viewController in self.viewControllers) {
        if ([viewController isKindOfClass:viewControllerClass]) {
            [self popToViewController:viewController animated:animated];
            return;
        }
    }
    [self popViewControllerAnimated:animated];
}

@end
